/**
 * 
 */
package com.firebird.oms.domain.bm;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author qiuxj 创建于 2009-11-28
 * 
 */
@Entity
@Table(name = "tibm_order_queue")
public class TibmOrderQueue implements Serializable {

	private static final long serialVersionUID = -8068039506386334919L;
	private String orderId;
	private String crmSeq;
	private Integer orderType;
	private String custName;
	private Integer cardType;
	private String cardCode;
	private Integer prodType;
	private String prodTypeDesc;
	private Integer comboId;
	private String comboName;
	private String accNbr;
	private Integer areaId;
	private String areaName;
	private String relaPhone;
	private String mobilePhone;
	private String relaAddr;
	private Integer orderState;
	private Integer state;
	private Integer createStaff;
	private Integer modifyStaff;
	private Date createTime;
	private Date modifyTime;
	private String dealDesc;

	public TibmOrderQueue() {

	}

	public TibmOrderQueue(String orderId, Integer orderType, String custName,
			Integer areaId, String relaPhone, String relaAddr,
			Integer orderState, Integer state, Integer createStaff,
			Date createTime) {
		this.orderId = orderId;
		this.orderType = orderType;
		this.custName = custName;
		this.areaId = areaId;
		this.relaPhone = relaPhone;
		this.relaAddr = relaAddr;
		this.orderState = orderState;
		this.state = state;
		this.createStaff = createStaff;
		this.createTime = createTime;
	}

	@Id
	@Column(name="order_id", unique = true, nullable = false)
	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	
	@Column(name = "crm_seq", length = 24)
	public String getCrmSeq() {
		return crmSeq;
	}

	public void setCrmSeq(String crmSeq) {
		this.crmSeq = crmSeq;
	}

	@Column(name = "order_type")
	public Integer getOrderType() {
		return orderType;
	}

	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}

	@Column(name = "cust_name", length = 30)
	public String getCustName() {
		return custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}

	@Column(name = "card_type")
	public Integer getCardType() {
		return cardType;
	}

	public void setCardType(Integer cardType) {
		this.cardType = cardType;
	}

	@Column(name = "card_code", length = 30)
	public String getCardCode() {
		return cardCode;
	}

	public void setCardCode(String cardCode) {
		this.cardCode = cardCode;
	}
	
	@Column(name = "prod_type")
	public Integer getProdType() {
		return prodType;
	}

	public void setProdType(Integer prodType) {
		this.prodType = prodType;
	}
	
	@Transient
	public String getProdTypeDesc() {
		return prodTypeDesc;
	}

	public void setProdTypeDesc(String prodTypeDesc) {
		this.prodTypeDesc = prodTypeDesc;
	}

	@Column(name = "combo_id")
	public Integer getComboId() {
		return comboId;
	}

	public void setComboId(Integer comboId) {
		this.comboId = comboId;
	}

	@Transient
	public String getComboName() {
		return comboName;
	}

	public void setComboName(String comboName) {
		this.comboName = comboName;
	}

	@Column(name="acc_nbr", length = 60)
	public String getAccNbr() {
		return accNbr;
	}

	public void setAccNbr(String accNbr) {
		this.accNbr = accNbr;
	}

	@Column(name="area_id")
	public Integer getAreaId() {
		return areaId;
	}

	public void setAreaId(Integer areaId) {
		this.areaId = areaId;
	}
	
	@Transient
	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	@Column(name="rela_phone", length = 20)
	public String getRelaPhone() {
		return relaPhone;
	}

	public void setRelaPhone(String relaPhone) {
		this.relaPhone = relaPhone;
	}

	@Column(name="mobile_phone", length = 20)
	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	@Column(name="rela_addr", length = 255)
	public String getRelaAddr() {
		return relaAddr;
	}

	public void setRelaAddr(String relaAddr) {
		this.relaAddr = relaAddr;
	}

	@Column(name="order_state")
	public Integer getOrderState() {
		return orderState;
	}

	public void setOrderState(Integer orderState) {
		this.orderState = orderState;
	}
	
	@Column(name="state")
	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name="create_staff")
	public Integer getCreateStaff() {
		return createStaff;
	}

	public void setCreateStaff(Integer createStaff) {
		this.createStaff = createStaff;
	}

	@Column(name="modify_staff")
	public Integer getModifyStaff() {
		return modifyStaff;
	}

	public void setModifyStaff(Integer modifyStaff) {
		this.modifyStaff = modifyStaff;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time", length = 0)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="modify_time", length = 0)
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "deal_desc", length = 65535)
	public String getDealDesc() {
		return dealDesc;
	}

	public void setDealDesc(String dealDesc) {
		this.dealDesc = dealDesc;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TibmOrderQueue))
			return false;
		TibmOrderQueue castOther = (TibmOrderQueue) other;
		return new EqualsBuilder().append(orderId, castOther.orderId).append(
				orderType, castOther.orderType).append(custName,
				castOther.custName).append(cardType, castOther.cardType)
				.append(cardCode, castOther.cardCode).append(prodType,
						castOther.prodType).append(comboId,
								castOther.comboId).append(comboName,
										castOther.comboName).append(accNbr, castOther.accNbr)
				.append(areaId, castOther.areaId).append(areaName,
						castOther.areaName).append(relaPhone,
						castOther.relaPhone).append(mobilePhone,
						castOther.mobilePhone).append(relaAddr,
						castOther.relaAddr).append(orderState,
						castOther.orderState).append(state, castOther.state)
				.append(createStaff, castOther.createStaff).append(modifyStaff,
						castOther.modifyStaff).append(createTime,
						castOther.createTime).append(modifyTime,
						castOther.modifyTime).append(dealDesc,
						castOther.dealDesc).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(orderId).append(orderType).append(
				custName).append(cardType).append(cardCode).append(prodType)
				.append(comboId).append(comboName).append(accNbr).append(areaId).append(areaName).append(
						relaPhone).append(mobilePhone).append(relaAddr).append(
						orderState).append(state).append(createStaff).append(
						modifyStaff).append(createTime).append(modifyTime)
				.append(dealDesc).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("orderId", orderId).append(
				"orderType", orderType).append("custName", custName).append(
				"cardType", cardType).append("cardCode", cardCode).append(
				"prodType", prodType).append(
						"comboId", comboId).append(
								"comboName", comboName).append("accNbr", accNbr).append("areaId",
				areaId).append("areaName", areaName).append("relaPhone",
				relaPhone).append("mobilePhone", mobilePhone).append(
				"relaAddr", relaAddr).append("orderState", orderState).append(
				"state", state).append("createStaff", createStaff).append(
				"modifyStaff", modifyStaff).append("createTime", createTime)
				.append("modifyTime", modifyTime).append("dealDesc", dealDesc)
				.toString();
	}

}
